# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-rprogram
_gemname=rprogram
pkgver=0.3.2
pkgrel=16
pkgdesc='A library for creating wrappers around command-line programs.'
arch=('any')
license=('GPL3')
depends=('ruby')
url='https://github.com/postmodern/rprogram#readme'
source=("http://rubygems.org/downloads/$_gemname-$pkgver.gem")
sha512sums=('42bf5a9197e1ed029cd0ef59674b86bdc2e0bb4d48af949219fa7af9f660ec67f3fa3aec49f386248d8bbed38f4488dab29bd7c676f42dfe04131d982f48f0c0')
noextract=("$_gemname-$pkgver.gem")

package() {
  _gemdir=$(ruby -rubygems -e 'puts Gem.default_dir')

  if [[ $CARCH == arm* ]] ; then
    gem install --no-user-install --ignore-dependencies --no-rdoc --no-ri \
      -n "$pkgdir/usr/bin" -i "$pkgdir$_gemdir" "$_gemname-$pkgver.gem"
  else
    gem install --no-user-install --ignore-dependencies -i "$pkgdir$_gemdir" \
      -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"
  fi
}

